﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace SIP.Controles
{
    public partial class MessageBoxOK : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            btnOk.OnClientClick = String.Format("fnClickOK('{0}','{1}')", btnOk.UniqueID, "");

        }
          public void ShowMessage(string Message)
        {

           this.lblMessage.Text = Message;
           this.lblCaption.Text = "";
           this.tdCaption.Visible = false;
           this.mpext.Show();
        }

        public void ShowMessage(string Message, string Caption)
        {
            this.lblMessage.Text = Message;
            this.lblCaption.Text = Caption;
            this.tdCaption.Visible = true;
            this.mpext.Show();
        }

        private void Hide()
        {
            this.lblMessage.Text = "";
            this.lblCaption.Text = "";
            this.mpext.Hide();
        }

        public void btnOk_Click(object sender, EventArgs e)
        {
            OnOkButtonPressed(e);
        }

        public delegate void OkButtonPressedHandler(object sender, EventArgs args);
        public event OkButtonPressedHandler OkButtonPressed;
        protected virtual void OnOkButtonPressed(EventArgs e)
        {
            if (OkButtonPressed != null)
                OkButtonPressed(btnOk, e);
        }
    }
}

